#include "comm.hpp"

int main()
{
    // 获取共享内存
    int shmid = GetShm();
    // 挂载
    char* shmaddr = (char*)shmat(shmid, nullptr, 0);

    int fd = open(FIFO_FILE, O_WRONLY);
    if(fd < 00)
    {
        lg(Fatal, "err code: %d, error string: %s", errno, strerror(errno));
        exit(FIFO_OPEN_ERR);
    }
    // ipc code
    while(true)
    {
        std::cout << "Please Enter@ ";
        fgets(shmaddr, 4094, stdin);

        write(fd, "c", 1);
    }
    shmdt(shmaddr);

    return 0;
}